home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 February / Macworld (1998-02).dmg / Inside Macworld / Alphamania 2 & Effector Sets / AlphaMania 2 / methods and modes.dir / 00018_Script_18 < prev    next >
Text File  |  1997-12-19  |  1KB  |  49 lines

  1. on Init
  2.   global kCandyHeartSprite, kCandyStartPoint
  3.   set kCandyHeartSprite = 15
  4.   set the drawmethod of member "candyheart" = #normal
  5.   set kCandyStartPoint = point(the locH of sprite kCandyHeartSprite,¨
  6.  the locV of sprite kCandyHeartSprite)
  7.   UpdateOutput("normal")
  8. end
  9.  
  10. on VerifyEffect fxSym
  11.   set fxList = GetListOfAllEffects(member "candyheart")
  12.   return(GetPos(fxList, fxSym))
  13. end
  14.  
  15.  
  16. on UpdateOutput fName
  17.   set the fontStyle of member "output" = "plain"
  18.   put field fName into field "output"
  19.   set the fontStyle of member "output" = "plain"
  20. end
  21.  
  22. on CenterSprite
  23.   global kCandyStartPoint, kCandyHeartSprite
  24.   set the locH of sprite kCandyHeartsprite = the locH of kCandyStartPoint
  25.   set the locV of sprite kCandyHeartSprite = the locV of kCandyStartPoint
  26.   updateStage
  27. end
  28.  
  29.  
  30.  
  31. on StylizeOutput
  32.   set hit1 = "the sourceMember"
  33.   set hit2 = "the sourcePosition"
  34.   ScanAndBold("output", hit1)
  35.   ScanAndBold("output", hit2)
  36. end
  37.  
  38. on ScanAndBold fName, hit
  39.   -- will boldface the first occurrence of hit in field
  40.   if field fName contains hit then
  41.     set whereStart = offset(hit, field fName)
  42.     if whereStart then
  43.       set the fontStyle of char whereStart to whereStart + length(hit) ¨
  44. of field fName = "bold"
  45.     end if
  46.   end if
  47. end
  48.  
  49.